<!-- BEGIN: PAGECONTENT -->
        <script type="text/javascript">
            $(document).ready(function() {
                //validate signup form on keyup and submit
                $("#admin_form").validate({
                    rules: {
                    	Title: {
                            required: true,
                            maxlength: 500
                        },
                        MetaKeyword: "required"
                    },
                    messages: {
                        Title: {
                            required: "Tiêu đề không được phép để chống",
                            maxlength: "Tiêu đề không nên dài quá 500 ký tự"
                        },
                        MetaKeyword: "Hãy điền meta keyword"
                    }
                });
                
                //Initialise FancyBox Modal window:
                $("a.fancy").fancybox({
                    'titlePosition' : 'inside'
                });
                
	             $("#error").fancybox({
	                'titlePosition' : 'inside'
	             });
                
            });
        </script>
        <script type="text/javascript">
			function BrowseServer()
			{
			    var finder = new CKFinder();
			    finder.basePath = 'Images/icon';
			    finder.selectActionFunction = SetFileField;
			    finder.popup();
			}
			
			// This is a sample function which is called when a file is selected in CKFinder.
			function SetFileField( fileUrl )
			{
			    $("#ImageLink").val(fileUrl);
                $("a.fancy").attr("href", fileUrl);
                $("#upload-img").attr("src",fileUrl);
			}
	    </script>
        <div class="form-content-page">
            <section>
                <form class="block-content form" id="admin_form" method="post" action="submit.php?ctrl={CONTROLLER}&act={ACTION}">
                    <h2>Cấu hình thông tin website</h2>
                    <!-- BEGIN: FORMITEM -->
                    <fieldset>
                        <input type="hidden" name="ID" id="ID" value="{FORMITEM.ID}">
                        <p>
                            <label for="simple-required">Title của website: </label>
                            <input type="text" name="TitleTag" id="TitleTag" value="{FORMITEM.TitleTag}" class="full-width">
                        </p>
                        <p>
                            <label for="simple-calendar">Website Icon: </label>
                                <input type="text" name="Icon" id="ImageLink" value="{FORMITEM.Icon}" class="half-width">
                                &nbsp;&nbsp; <button type="button" class="grey browser-file" onclick="BrowseServer();">Chọn ảnh</button>
                            <br />
                            <div style="width: 100%" align="center">
                               <a href="{FORMITEM.Icon}" class="fancy" rel="group" id="upload-img-fancy"><img src="{FORMITEM.Icon}" id="upload-img" style="max-height: 250px;"></a>
                            </div>
                        </p>
                        <p>
                            <label for="simple-required">Meta Keyword:</label>
                            <textarea name="MetaKeyword" id="MetaKeyword" class="full-width height-100">{FORMITEM.MetaKeyword}</textarea>
                        </p>
                        <p>
                            <label for="simple-required">Meta Description:</label>
                            <textarea name="MetaDescription" id="MetaDescription" class="full-width height-200">{FORMITEM.MetaDescription}</textarea>
                        </p>
                        <p>
                            <label for="simple-required">Header Script:</label>
                            <textarea name="HeaderScript" id="HeaderScript" class="full-width height-200">{FORMITEM.HeaderScript}</textarea>
                        </p>
                        <p>
                            <label for="simple-required">Body Script:</label>
                            <textarea name="BodyScript" id="BodyScript" class="full-width height-200">{FORMITEM.BodyScript}</textarea>
                        </p>
                        <p>
                            <label for="simple-required">BackLink:</label>
                            <textarea name="BackLink" id="BackLink" class="full-width height-200">{FORMITEM.BackLink}</textarea>
                            <script type="text/javascript">
                                   //<![CDATA[
               
                                   var editorBackLink = CKEDITOR.replace('BackLink', {
                                       skin : 'v2',
                                       removePlugins : 'resize',
                                       extraPlugins : 'autogrow',
                                       toolbar :
                                       [
                                           ['Source','-','Undo','Redo','-','Copy','Paste'],
                                           ['FontSize','TextColor', 'Bold', 'Italic','Underline'],
                                           ['Format','Link','-','Unlink'],
                                       ]
                                   });
               
                                   //]]>
                           	</script>
                        </p>
                    </fieldset>
                    <fieldset class="grey-bg no-margin">
                        <p class="input-with-button" align="center">
                            <button type="submit"> Hoàn thành </button>
                        </p>
                    </fieldset>
                    <!-- END: FORMITEM -->
                </form>
            </section>
        </div>
<!-- END: PAGESITE -->